package org.beanutopia.function;

/**
 * @author ymeymann
* @since Oct 30, 2007 11:38:48 PM
*/
public class SupertypePredicate<T> extends TypePredicate<T> {

  public SupertypePredicate(Class<? extends T> c) {
    super(c);
  }

  public boolean apply(T o) {
    if (o instanceof Class)
      return (((Class<?>)o).isAssignableFrom(klass));
    else
      return (o != null && o.getClass().isAssignableFrom(klass));
  }

}
